// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   BaseServlet.java

package com.itheima.travel.web.servlet;

import java.io.IOException;
import java.lang.reflect.Method;
import javax.servlet.*;
import javax.servlet.http.*;

public class BaseServlet extends HttpServlet
{

	public BaseServlet()
	{
	}

	public void service(ServletRequest req, ServletResponse res)
		throws ServletException, IOException
	{
		try
		{
			HttpServletRequest request = (HttpServletRequest)req;
			HttpServletResponse response = (HttpServletResponse)res;
			Class clazz = getClass();
			String methodName = req.getParameter("action");
			Method method = clazz.getDeclaredMethod(methodName, new Class[] {
				javax/servlet/http/HttpServletRequest, javax/servlet/http/HttpServletResponse
			});
			method.setAccessible(true);
			method.invoke(this, new Object[] {
				request, response
			});
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}
